import { Result, deleteRequest, get, post, put } from "../base";
/**
 * 查询
 * @param path .
 * @returns .
 */
export function treeList<T>(type: any): Promise<Result<T>> {
  return get("/sci/account/tree", { type });
}

/**
 * 查询全部
 * @param query .
 * @returns .
 */
export function treeListAll<T>(): Promise<Result<T>> {
  return get("/sci/account/treeAll");
}
/**
 * 新增
 * @param data .
 * @returns .
 */
export function save<T>(data: any): Promise<Result<T>> {
  return post("/sci/account/save", data);
}
/**
 * 更新
 * @param id .
 * @param data .
 * @returns  .
 */
export function update<T>(data: any): Promise<Result<T>> {
  return put(`/sci/account/update`, {}, data);
}

/**
 * 删除用户
 * @param userIds .
 * @returns
 */
export function del<T>(userId: any): Promise<Result<T>> {
  return deleteRequest(`/sci/account/delete`, {}, userId);
}

export function getTime<T>(): Promise<Result<T>> {
  return get("/sci/account/time");
}
export function checkTime<T>(): Promise<Result<T>> {
  return get("/sci/account/checkTime");
}
export function updateTime<T>(data: any): Promise<Result<T>> {
  return put(`/sci/account/updateTime`, {}, data);
}
